<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>活动报名后台管理系统</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/layui.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <a id="logo" href="/home/toIndex">
            <div class="layui-logo" style="font-size: x-large;margin-left: 1%;width: 260px">活动报名后台管理系统</div>
        </a>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img th:src="${session.user.avatar}" class="layui-nav-img">
                    [[${session.username}]]
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/home/toUserinfo">基本资料</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/logout">注销</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li th:each="layUiTree:${layUiTreeList}" class="layui-nav-item layui-nav-itemed">
                    <a class="" th:href="${layUiTree.url}">
                        <i th:class="${layUiTree.icon}"></i>
                        <span th:text="${layUiTree.title}"></span>
                    </a>
                    <dl class="layui-nav-child" th:each="children:${layUiTree.children}">
                        <dd>
                            <a th:href="${children.url}">
                                <span style="margin-left: 12px" th:text="${children.title}"></span>
                            </a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe id="iframeMain" src="/home/toIndex" class="layadmin-iframe" frameborder="0"
                style="width: 100%;height: 100%"></iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © 86521760@qq.com
    </div>
</div>
<script>
    //JavaScript代码区域
    layui.use(['element', 'jquery'], function () {
        let element = layui.element;
        let $ = layui.jquery;
        $(function () {
            //页面加载之后执行的代码
            //点击a标签的时候，修改iframe的src属性
            $("dd>a").click(function (event) {
                //阻断超链接的跳转事件
                event.preventDefault();
                //取得超链接对象的href属性值赋给iframe的src属性
                $("#iframeMain").attr("src", $(this).attr("href"));
            })
            //点击logo到首页
            $("#logo").click(function (event) {
                //阻断超链接的跳转事件
                event.preventDefault();
                $("#iframeMain").attr("src", $(this).attr("href"));
            })
        })
    });
</script>
</body>
</html>